using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SmartLink.Domain.Entity;
using SmartLink.Domain.ExpandEntity.Oragnization;
using SmartLink.EnumLibrary;

namespace SmartLink.IRepository
{
    public interface IBIZ_OrganizationRepo : IRepository<BIZ_Organization>
    {
        bool CheckExistByOrgName(string orgName);
        IList<OrganizationManageExpand> GetOrganizationList(int status, int district, string keyValue, int pageIndex, int pageSize, bool isSearchTotal, out int count);
        SingleOragnizationInfoExapnd GetSingleOrganization(int orgId);
        IList<BIZ_Organization> OrganizationListinfo();
        /// <summary>
        /// 获取祖先节点结婚
        /// </summary>
        /// <param name="topOid"></param>
        /// <returns></returns>
        IEnumerable<BIZ_Organization> GetAncestors(int topOid, bool withSelf = false);
        /// <summary>
        /// 获取后代节点结婚
        /// </summary>
        /// <param name="topOid"></param>
        /// <returns></returns>
        IEnumerable<BIZ_Organization> GetDescendants(int topOid, bool withSelf = false);
        /// <summary>
        /// 获取所有根公司（ParentID 为 null）
        /// </summary>
        /// <returns></returns>
        IEnumerable<BIZ_Organization> GetRootOrganizations();
        /// <summary>
        /// 获取公司的根公司ID
        /// </summary>
        /// <param name="oid"></param>
        /// <returns></returns>
        int GetRootOrganizationId(int oid);
        /// <summary>
        /// 获取根机构及所有后代机构ID集合
        /// </summary>
        IEnumerable<int> GetRootOrgDescendantsIds(int roid);
    }
}
